import request from '@/axios'
import type { RuleData, searchData } from './types'

export const getListApi = (data: Partial<searchData>) => {
  return request.post({ url: '/logistics/list', data })
}

export const getInfoApi = (id: string): Promise<IResponse<RuleData>> => {
  return request.get({ url: `/logistics/info/${id}` })
}

export const deleteDataApi = (id: string[] | number[]): Promise<IResponse> => {
  return request.get({ url: `/logistics/delete/${id}` })
}

export const addDataApi = (data: Partial<RuleData>): Promise<IResponse> => {
  return request.post({ url: '/logistics/add', data })
}

export const updateDataApi = (data: Partial<RuleData>): Promise<IResponse> => {
  return request.post({ url: '/logistics/update', data })
}
